<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:include page="directive.jsp" />
<jsp:include page="header.jsp"/>
<c:choose>
<c:when test="${!empty param.id}">
    <jsp:setProperty name="product" property="productID" value="${param.id}"/>
    <c:set var="prod" value="${product.product}" />
    <div id="inner_wrap">
    <div id="inner_hold">
	<div id="inner">
		<div id="main_block" class="pop-loading">
			<div class="main_leaf0"></div>
			<div id="main_photoer">
				<div id="main_photo_only">
                    <div id="main_photo_bg"><img src="product_big_img/${param.id}.jpg" width="869" height="520" alt="${prod.description}" title="${prod.productName}" id="main_pic" /></div>
				</div>
			</div>

			<div id="main_block_right">
				<div class="font_small" style="margin-bottom: 10px"><a href="product.jsp?id=${param.id - 1}" class="blue">&laquo; Prev item</a>
				<a href="product.jsp?id=${param.id + 1}" class="blue" style="margin-left: 40px">Next item &raquo;</a></div>

				<h1><a href="product.jsp?id=${param.id}" title="${prod.description}">${prod.productName}</a></h1>
                <p class="font_small">${prod.categoryID.categoryName}</p>

				<div id="bag_gen">
					<ul>
						<li id="s_but_0" class="active"><a href="product.jsp?id=${param.id}">Product Code ${param.id}</a></li>
					</ul>
				</div>

				<form action="cart.jsp" method="post" id="addcart">
				<div id="baggy">
					<div style="padding: 5px 10px">
                        ${prod.description}
                    </div>
					<br />

                    <div id="bag_holder">
                        <div id="bag_content">
                            <table width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td valign="top" class="bag_dot">
                                        <div id="bag_stock">
                                            <table width="100%" cellspacing="3" cellpadding="0">
                                                <tr>
                                                    <td width="95"><label for="radiosz_m" style="color: #3f3f3f">Shipping</label></td>
                                                    <td>${prod.shippingPriceCost}</td>
                                                </tr>
                                                <tr>
                                                    <td width="95"><label for="radiosz_m" style="color: #3f3f3f">Tax</label></td>
                                                    <td>${prod.taxPercent * 100}%</td>
                                                </tr>
                                                <tr>
                                                    <td width="95"><label for="radiosz_m" style="color: #3f3f3f">Discount</label></td>
                                                    <td><em>Be a VIP member and get discount at checkout!</em></td>
                                                </tr>
                                            </table>
                                        </div>
                                        <p class="font_small" style="margin-left: 33px; padding-top: 6px">Not sure? <a href="contact.jsp" class="blue">Contact Us</a></p>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>

					<div class="bag_dot">
                    	<div id="bag_price">$ ${prod.unitPrice}</div>
						<input type="hidden" name="productID" value="${param.id}" />
						<input type="hidden" name="quantity" value="1" />
						<div id="bag_submit"><input type="submit" id="submit" class="but_add" value=" " /></div>
					</div>
				</div>
				</form>
			</div>
		</div>
		<div class="pro_bot_holder">
			<div class="pro_bottomer">
                <h3 style="padding-bottom: 10px">You might also like</h3>
                <c:forEach items="${product.relatedProductList}" var="item" varStatus="status">
                    <div class="four_clmn_s" <c:if test="${status.last}">style="margin-right: 0"</c:if>><a href="product.jsp?id=${item.productID}"><img src="product_img/${item.productID}.jpg" width="114" height="139" class="thumby" /></a>
                        <div class="title_pro"><a href="product.jsp?id=${item.productID}" class="blue">${item.productName}</a></div>
                    </div>
                </c:forEach>
                <div class="empty"></div>
			</div>
		</div>
    </div>
    </div>
    </div>
</c:when>
<c:otherwise>
    <h1>Please choose a product first!</h1>
</c:otherwise>
</c:choose>
<jsp:include page="footer.jsp"/>